[SUBROUTINE]
version = 1.14
icon = threading-v.png
name = _("Thread Milling")
type = thread-milling
help = _("<b>Create internal or external threads</b>")
order = act pv h1 cx al_x cy al_y h3 opt dir rot s u_s ugc dpt u_dpt ugcd h4 m_i maj_d min_d pitch starts

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_PV]
name = _("Show design")
icon = glasses.png
type = bool
value = 1

[PARAM_H1]
name = _("Coords, size")
type = sub-header

[PARAM_CX]
name = _("cX")
type = float
icon = center.png
tool_tip = _("Center of helix")
value = 0.0
metric_value = 0.0
header = h1

[PARAM_AL_X]
name = _("X axis align")
icon = align-x.png
type = combo
options = _("Left=0:Center=1:Right=2")
header = h1
value = 1
tool_tip = _("Define X reference point")

[PARAM_CY]
name = _("cY")
type = float
icon = center.png
tool_tip = _("Center of helix")
value = 0.0
metric_value = 0.0
header = h1

[PARAM_AL_Y]
name = _("Y axis align")
icon = align-y.png
type = combo
options = _("Top=0:Center=1:Bottom=2")
header = h1
value = 1
tool_tip = _("Define Y reference point")

[PARAM_H3]
name = _("Milling")
type = sub-header

[PARAM_OPT]
name = _("Option")
type = combo
options = _("Internal=2:External=3")
icon = thread-in-out.png
tool_tip = _("Select helix side")
value = 2
header = h3

[PARAM_DIR]
name = _("Direction")
type = combo
options = _("Clockwise (RH)=3:Counter-clockwise (LH)=2")
icon = cw-ccw.png
tool_tip = _("Direction of path")
value = 3
header = h3

[PARAM_ROT]
name = _("Rotation")
type = float
digits = 2
icon = angle.png
tool_tip = _("Rotation of start location")
value = 0.0
header = h3
suffix = &#176;

[PARAM_S]
name = _("Helix top")
type = combo-user
options = _("User defined=0:Surface=1:Half=2:One quarter=3:Three quarter=4:G-Code=5")
icon = surface.png
tool_tip = _("Pre or user defined")
value = 1
header = h3
links = u_s=0:ugc=5

[PARAM_U_S]
name = _("User top")
type = float
value = 0.0
metric_value = 0.0
header = h3
hidden = 1

[PARAM_UGC]
name = User gcode
type = gcode
value = 
header = h3
hidden = 1

[PARAM_UGCD]
name = User depth gcode
type = gcode
value =
header = h3
hidden = 1

[PARAM_DPT]
name = _("Helix bottom")
type = combo-user
options = _("User defined=0:Through=1:Bottom=2:Half=3:One quarter=4:Three quarter=5:G-Code=6")
icon = depth.png
tool_tip = _("Pre or user defined")
value = 1
header = h3
links = u_dpt=0:ugcd=6

[PARAM_U_DPT]
name = _("User bottom")
type = float
value = -0.5
metric_value = -12.0
header = h3
hidden = 1

[PARAM_H4]
name = _("Helix")
type = sub-header

[PARAM_M_I]
name = _("Units")
type = combo
icon = mm-in.png
options = _("Imperial=0:Metric=1")
value = 0
header = h4

[PARAM_MAJ_D]
name = _("Major diameter")
type = float
minimum_value = 0.0
icon = thread-v-d.png
tool_tip = _("Major diameter")
value = 1.0
header = h1
metric_value = 25
not_allowed = 0

[PARAM_MIN_D]
name = _("Minor diameter")
type = float
minimum_value = 0.0
icon = diameter.png
tool_tip = _("Minor diameter")
value = 0.8
header = h1
metric_value = 20
not_allowed = 0

[PARAM_PITCH]
name = _("Pitch")
type = float
minimum_value = 0.0
tool_tip = _("Metric pitch is thread to thread, imperial is per inch")
icon = thread-pitch-v.png
value = 12
header = h4
metric_value = 2
not_allowed = 0

[PARAM_STARTS]
name = _("Starts")
type = int
minimum_value = 1
tool_tip = _("Number of helix")
value = 1
header = h4
icon = helix-count.png


[DEFINITIONS]
content =
;	<eval>self.include_once(file name here)</eval>

[CALL]
content =
	(begin #sub_name)
	(authors : Fernand Veilleux and Philip Mullen)
	
	o<#self_id_active> if [#param_act AND [#<_tool_usage> EQ 4]] (if active)
		o<select> CALL [31] [#param_s] [#param_u_s] [#<surface>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugc]
		o<select> CALL [32] [#param_dpt] [#param_u_dpt] [#<bottom_through>] [#<bottom>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugcd]
		
		o<thread-milling> CALL [#param_cx] [#param_al_x] [#param_cy] [#param_al_y] [#param_maj_d] [#param_min_d] [#param_pitch] [#param_m_i] [#param_starts] [#param_rot] [#param_opt] [#param_dir] [#31] [#32] [#param_pv] [0]
		
	o<#self_id_active> endif
	(end #sub_name)
